{% extends "master_noauth.html" %}

{% block nav %}
    {% if g.fas_user %}
    <li id="mysitesTab"><a href="{{url_for('mysite')}}">My Sites</a></li>
    {% endif %}
    {% if is_admin %}
    <li id="adminTab"><a href="{{url_for('admin.index')}}">Admin</a></li>
    <li id="allSitesTab"><a href="{{url_for('all_sites')}}">All sites</a></li>
    {% endif %}
{% endblock %}


{% block loginstatus %}
{% if g.fas_user %}
<li class="nav-item dropdown ml-1">
    <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
        <span class="fa fa-user fa-lg"></span>
    </a>
    <div class="dropdown-menu dropdown-menu-right">
        <div class="dropdown-header">
            <strong>{{ g.fas_user.username }}</strong>
        </div>
        <div class="dropdown-divider"></div>
        <a class="dropdown-item" href="{{url_for('mysite')}}">My Sites</a>
        <a class="dropdown-item" href="{{ url_for('auth_logout') }}?next={{request.url}}">Log Out</a>
        {% if is_admin %}
        <div class="dropdown-divider"></div>
        <div class="dropdown-header">
            <strong>Admin Options</strong>
        </div>
        <a class="dropdown-item" href="{{url_for('admin.index')}}">Admin Panel</a>
        <a class="dropdown-item" href="{{url_for('all_sites')}}">All sites</a>
        {% endif %}
    </div>
</li>
{% else %}
<a class="btn btn-primary ml-2" href="{{ url_for('auth_login') }}?next={{request.url}}">Login</a>
{% endif %}
{% endblock %}
